package com.example.demo.controller;

import com.example.demo.domain.vo.ProcessInstanceVo;
import com.example.demo.service.SystemChooseProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 系统选择类型
 * @Author: zsg
 * @Date: 2018/07/12 14:00
 */
@RestController
@RequestMapping("system")
public class SystemChooseProcessController {


    @Autowired
    private SystemChooseProcessService systemChooseProcessService;

    /**
     * 开启一个流程
     * @param processKey
     * @param userId
     * @param money 选择的条件
     * @return
     */
    @GetMapping("startprocess")
    public List<ProcessInstanceVo> startprocess(@RequestParam("processKey") String processKey, @RequestParam("userId") String userId, @RequestParam("money") double money){
        List<ProcessInstanceVo> voList = this.systemChooseProcessService.startProcess(processKey, userId, money);
        return  voList;
    }
}
